﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.BUS;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.DAL;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;
using System.Data;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.BUS
{
    class UserBusSanPham
    {
        private SanPham SP;

        public UserBusSanPham()
        {
            SP = new SanPham();
        }

        public bool Insert(UserVOSanPham obj)
        {
            return SP.Insert(obj.MANHOM,obj.MANCC,obj.TENSANPHAM,obj.SOLUONGHIENCO,obj.DONGIA);
        }

        public bool Update(UserVOSanPham obj)
        {
            return SP.Update(Convert.ToInt32(obj.MASANPHAM), obj.MANHOM, obj.MANCC, obj.TENSANPHAM, obj.SOLUONGHIENCO, obj.DONGIA);
        }

        public bool Delete(UserVOSanPham obj)
        {
            return SP.Delete(obj.MASANPHAM);
        }

        public DataTable SelectAllTable()
        {
            return SP.SelectAll();
        }

        public DataTable SelectID(int MaSP)
        {
            return SP.SelectID(MaSP);
        }
    }
}
